/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.trade;

import com.enation.app.javashop.client.trade.PintuanGoodsClient;
import com.enation.app.javashop.core.client.fallback.trade.PintuanGoodsClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zh
 * @version v1.0
 * @Description: 拼团索引
 * @date 2019/3/5 10:33
 * @since v7.0.0
 */
@FeignClient(name = "trade-service", fallbackFactory = PintuanGoodsClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface PintuanGoodsClientFeignImpl extends PintuanGoodsClient {

    /**
     * 生成拼团索引
     *
     * @param promotionId 拼团活动ID
     * @return 生成结果
     */
    @Override
    @RequestMapping(value = "/client/pintuan/promotion/{promotion_id}", method = RequestMethod.POST)
    boolean createGoodsIndex(@PathVariable("promotion_id") Long promotionId);


    /**
     * 删除某个商品的所有sku索引
     * @param goodsId
     */
    @Override
    @RequestMapping(value = "/client/pintuan/goods/{goods_id}/del", method = RequestMethod.POST)
    void deleteIndexByGoodsId(@PathVariable("goods_id")Long goodsId);

    /**
     * 同步一个商品的所有sku的索引
     * @param goodsId
     */
    @Override
    @RequestMapping(value = "/client/pintuan/goods/{goods_id}/sync-index", method = RequestMethod.POST)
    void syncIndexByGoodsId(@PathVariable("goods_id")Long goodsId);

    /**
     * 删除拼团商品
     * @param goodsId
     */
    @Override
    @RequestMapping(value = "/client/pintuan/goods/{goods_id}/del-all", method = RequestMethod.POST)
    void delete(@PathVariable("goods_id")Long goodsId);

    /**
     * 删除拼团商品
     * @param delSkuIds
     */
    @Override
    @DeleteMapping("/client/pintuan/goods")
    void deletePinTuanGoods(@RequestBody List<Long> delSkuIds);

}
